<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const s1 = ",";
      const r1 = new RegExp(",");

      const str = "a,b,c,d";
      console.log(str.split(s1));
      console.log(str.split(r1));
    </script>
  </body>
</html>
